<template>
    <div>
        <table>
            <tr>
                <td>会员id</td>
                <td>商品标题</td>
                <td>商品价格</td>
                <td>姓名</td>
                <td>手机号码</td>
            </tr>
            <tr v-for="i in order_list" :key="i.id">
                <td>{{i.user.id}}</td>
                <td>{{i.product.goods_name}}</td>
                <td>{{i.product.admin_price}}</td>
                <td>{{i.ding_name}}</td>
                <td>{{i.phone}}</td>
            </tr>

        </table>
    </div>
</template>

<script>
import axios from 'axios'
export default {
    data() {
        return{
            users:this.$route.query.user_id,
            order_list:[],
            base_url:'http://127.0.0.1:8000/',
        }
    },
    methods: {
        get(){
            console.log(this.users)
            axios(this.base_url+'order/?user_id='+this.users).then(
                res=>{
                    console.log(res.data)
                    this.order_list=res.data
                }
            )
        }
    },
    created() {
            this.get()
    }
}
</script>

<style scoped>

</style>
